package com.qqtech.qquan.user.model;

import java.math.BigDecimal;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.qqtech.core.common.util.StringUtil;

@SuppressWarnings("serial")
public class UserValueVo extends UserValue {
	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE);
	}

	/** 距离 */
	private BigDecimal distance;
	/** 昵称 */
	private java.lang.String nick;
	/** 用户头像 */
	private java.lang.String logo;

	/** 是否好友 **/
	private boolean isFriend = false;
	/** 是否邻居 **/
	private boolean isNeighbor = false;
	/** 共同加入圈子数量 **/
	private java.lang.Integer ourCircleCount;


	public java.lang.String getNick() {
		if (StringUtil.isBlank(nick)) {
			return "新手";
		}
		return nick;
	}

	public void setNick(java.lang.String nick) {
		this.nick = nick;
	}

	public BigDecimal getDistance() {
		return distance;
	}

	public void setDistance(BigDecimal distance) {
		this.distance = distance;
	}

	/** 距离-中文描述 **/
	public String getDistanceStr() {
		String distanceStr = "";
		if (this.distance != null) {
			BigDecimal temp = new BigDecimal(1000.0);
			if (distance.compareTo(temp) > 0) {
				return distance.divide(temp, 1, BigDecimal.ROUND_HALF_UP).doubleValue() + "公里";
			} else {
				return distance.intValue() + "米";
			}
		}
		return distanceStr;
	}

	public java.lang.String getLogo() {
		return logo;
	}

	public void setLogo(java.lang.String logo) {
		this.logo = logo;
	}

	public java.lang.String getFullLogo() {
		if (StringUtil.isBlank(this.getLogo())) {
			return "source://image/common/userLogin.png";
		} else if (this.getLogo().indexOf("source://") > -1) {
			return this.getLogo();
		} else {
			return super.getFileDomain() + "" + this.getLogo();
		}
	}

	public boolean isFriend() {
		return isFriend;
	}

	public void setFriend(boolean isFriend) {
		this.isFriend = isFriend;
	}

	public boolean isNeighbor() {
		return isNeighbor;
	}

	public void setNeighbor(boolean isNeighbor) {
		this.isNeighbor = isNeighbor;
	}

	public java.lang.Integer getOurCircleCount() {
		return ourCircleCount;
	}

	public void setOurCircleCount(java.lang.Integer ourCircleCount) {
		this.ourCircleCount = ourCircleCount;
	}

}